home *** CD-ROM | disk | FTP | other *** search
/ The PC-SIG Library 10 / The PC-Sig Library - Shareware for the IBM PC and Compatibles (PC-SIG)(Tenth Edition Disks 1-2804)(1991).iso / PC_SIGCD / 14 / 3 / DISK1430.ZIP / SRC / IO.HXZ / IO
Text File  |  1988-05-04  |  2KB  |  49 lines

  1. /***************************************************************************
  2.  * This program is Copyright (C) 1986, 1987, 1988 by Jonathan Payne.  JOVE *
  3.  * is provided to you without charge, and with no warranty.  You may give  *
  4.  * away copies of JOVE, including sources, provided that this notice is    *
  5.  * included in all the files.                                              *
  6.  ***************************************************************************/
  7.  
  8. #define putchar(c)    putc(c, stdout)
  9. #define putc(c, fp)    (--(fp)->f_cnt >= 0 ? (*(fp)->f_ptr++ = (c)) : _flush((c), fp))
  10. #define getc(fp)    (((--(fp)->f_cnt < 0) ? filbuf(fp) : *(fp)->f_ptr++))
  11.  
  12. typedef struct File {
  13.     int    f_cnt,        /* number of characters left in buffer */
  14.         f_bufsize,    /* size of what f_base points to */
  15.         f_fd,        /* fildes */
  16.         f_flags;    /* various flags */
  17.     char    *f_ptr,        /* current offset */
  18.         *f_base;    /* pointer to base */
  19.     char    *f_name;    /* name of open file */
  20. } File;
  21.  
  22. #define F_READ        01
  23. #define F_WRITE        02
  24. #define F_APPEND    04
  25. #define F_MODE(x)    (x&07)
  26. #define F_EOF        010
  27. #define F_STRING    020
  28. #define F_ERR        040
  29. #define F_LOCKED    0100    /* don't close this file upon error */
  30. #define F_MYBUF        0200    /* f_alloc allocated the buffer, so
  31.                    f_close knows to free it up */
  32. #define F_TELLALL    0400    /* whether to display info upon close */
  33.  
  34. extern long    io_chars;
  35. extern int    io_lines;
  36.  
  37. extern File
  38.     *stdout,
  39.  
  40.     *open_file(),
  41.     *fd_open(),
  42.     *f_open();
  43.  
  44. #ifdef VMUNIX
  45. #   define MAXTTYBUF    2048
  46. #else
  47. #   define MAXTTYBUF    512
  48. #endif
  49.